package com.design.pattern.flyweight.ticket;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @version 1.0
 * @author: CRM_SYSTEM
 * @date: 2022/10/18 22:22
 * @Description:
 */
public class TicketTest {


    public static void main(String[] args) {
        ITicket ticket = TicketFactory.queryTicket("成都东", "广元");
        ticket.showInfo("硬座");
        ITicket ticket1 = TicketFactory.queryTicket("成都东", "广元");
        ticket1.showInfo("硬座");
        System.out.println(ticket1==ticket);

        ITicket ticket2 = TicketFactory.queryTicket("成都东", "苍溪");
        ticket1.showInfo("硬座");
        System.out.println(ticket2==ticket);
    }
}
